﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Public/Public.Master" AutoEventWireup="true" CodeBehind="Post.aspx.cs" Inherits="NhanAi.Public.PostView" Culture="auto" meta:resourcekey="PageResource1" UICulture="auto" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>
        <%=CurrentLanguage=="vi"?Post.Title:Post.TitleEn %>
        </title>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
   
    <%if (Post.Protected)
      { %>
    <style>
        .protect {
            -webkit-user-select: none;
            -khtml-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            -o-user-select: none;
            user-select: none;
        }
    </style>
    <%} %>
    <div class="post-panel">
        <% string lang = CurrentLanguage; %>
        <h1 class="post-title"><%=lang=="vi"?Post.Title:Post.TitleEn %></h1>
        <small class="post-date"><%= lang=="vi"?Post.PostDate.ToString("dd/MM/yyyy hh:mm"):Post.PostDate.ToString("MM/dd/yyyy hh:mm") %> - <%= lang=="vi"?"Đăng bởi: ":"Posted by: " %> <%=Post.User.UserLogin %></small>
        <div class="protect" id="post-content">
            <%=lang=="vi"?Post.Content:Post.ContentEn %>
        </div>
    </div>    

    <ul class="social-share">
        <li style="margin-right: 15px;">
            <div class="fb-like" data-href="http://nhanaiclinic.com/Public/Post.aspx?id=<%=Post.Id %>" data-layout="button_count" data-action="like" data-show-faces="true" data-share="true"></div>
        </li>
        <li>
            <div class="g-plusone" data-size="medium"></div>
        </li>
        <li>
            <a href="https://twitter.com/share" class="twitter-share-button">Tweet</a>
            <script>!function (d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https';
    if (!d.getElementById(id)) {
        js = d.createElement(s);
        js.id = id;
        js.src = p + '://platform.twitter.com/widgets.js';
        fjs.parentNode.insertBefore(js, fjs);
    }
}(document, 'script', 'twitter-wjs');</script>
        </li>
    </ul>

    <div class="related-posts">
        <%if (RelatedPosts != null)
          { %>
        <h4><%=lang=="vi"?"Bài viết liên quan":"Related posts" %></h4>
        <ul>
            <% foreach (NhanAi.Entity.Post p in RelatedPosts)
               { %>
            <li><a href="Post.aspx?id=<%=p.Id %>&cate=<%=CateId %>"><%=lang=="vi"?p.Title:p.TitleEn %></a></li>
            <% } %>
        </ul>
        <%} %>
    </div>
    <%if (Post.Comments != null)
      {%>

    <div class="comments-panel">
        <h3><%= String.Format(GetGlobalResourceObject("HmLanguage","has_comments").ToString(),Post.Comments.Count) %> </h3>
        <ul class="comment-tree">
            <%foreach (NhanAi.Entity.Comment c in Post.Comments)
              { %>
            <li class="comment">
                <p class="quote">
                    [<%=c.CommentDate.ToString("dd/MM/yyyy hh:mm") %>] <strong><%=c.Author %></strong>
                    <asp:Literal runat="server" Text="<%$ Resources: HmLanguage,say %>" />:
                </p>
                <%=c.CommentContent %>
            </li>
            <%} %>
        </ul>
        <form id="frmComment" class="comment-form bottom-pad" method="post">
            <input type="hidden" name="submit-comment" value="1" />
            <p>
                <asp:Literal runat="server" Text="<%$ Resources:HmLanguage,put_comment %>" />
                :
            </p>
            <span style="color: red; font-weight: bold;"><%=Message %></span>
            <div>
                <label class="required">
                    <asp:Literal ID="Literal1" runat="server" Text="<%$ Resources:HmLanguage,author %>" />:</label><input type="text" name="author" id="author" />

            </div>
            <div>
                <label class="required">Email:</label><input type="text" name="email" />

            </div>
            <div>
                <label class="required">
                    <asp:Localize ID="localize2" runat="server" Text="<%$Resources:HmLanguage,comment %>" />:</label><textarea name="comment" id="comment"></textarea>
            </div>
            <input type="submit" id="btnSubmit" value='<%= lang=="vi"?"Gửi":"Submit" %>' />

        </form>
    </div>
    <%} %>
   
    <script type="text/javascript">
        (function () {
            var po = document.createElement('script');
            po.type = 'text/javascript';
            po.async = true;
            po.src = 'https://apis.google.com/js/plusone.js';
            var s = document.getElementsByTagName('script')[0];
            s.parentNode.insertBefore(po, s);
        })();
                </script>
</asp:Content>
